package com.zhrj.exam.controller;


import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mysql.jdbc.StringUtils;
import com.zhrj.exam.entity.Pagination;
import com.zhrj.exam.entity.ZhrjAlarmInfo;
import com.zhrj.exam.entity.ZhrjAlarmInfoVo;
import com.zhrj.exam.service.IZhrjAlarmInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 事件表 前端控制器
 * </p>
 *
 * @author zhrj
 * @since 2023-03-14
 */
@RestController
@RequestMapping("/zhrj-alarm-info/")
public class ZhrjAlarmInfoController {
    @Autowired
    IZhrjAlarmInfoService iZhrjAlarmInfoService;

    @GetMapping("/getListByQueryWrapperPage")
    public Page<ZhrjAlarmInfo> getUserListByQueryWrapperPage(String eventReasons) {
        Pagination pagination = new Pagination();
        pagination.setCurrentPage(1);
        pagination.setPageSize(3);
//        eventReasons="天气";
        System.out.println(eventReasons);
        return iZhrjAlarmInfoService.getUserListByQueryWrapperPage(pagination,eventReasons);
    }


    @GetMapping("/getListBySQLPage")
    public Page<ZhrjAlarmInfoVo> getUserListBySQLPage(Pagination pagination) {
        pagination.setCurrentPage(2);
        pagination.setPageSize(3);
        return iZhrjAlarmInfoService.getUserListBySQLPage(pagination);
    }

    @GetMapping("/getList")
    public List<ZhrjAlarmInfoVo> getList(String eventReasons) {

        return iZhrjAlarmInfoService.getList(eventReasons);
    }

}
